package cn.jingzhuan.element.demo

import android.annotation.SuppressLint
import android.app.Application
import cn.jingzhuan.element.demo.view.util.audio.AudioPlayerManager
import cn.jingzhuan.element.demo.view.util.audio.LifecycleHandler
import kotlin.properties.Delegates

@SuppressLint("Registered")
class App:Application(){

    lateinit var lifecycle : LifecycleHandler
    var serviceToken : AudioPlayerManager.ServiceToken? = null

    companion object {
        var instance : App by Delegates.notNull()
    }

    override fun onCreate() {
        super.onCreate()

        instance = this

        lifecycle = LifecycleHandler()
        registerActivityLifecycleCallbacks(lifecycle)

    }
}